#ifndef PAGEBATTERY_H
#define PAGEBATTERY_H

#include <QWidget>
#include <QLabel>
#include "global_def.h"

namespace Ui {
class PageBattery;
}

class PageBattery : public QWidget
{
    Q_OBJECT

public:
    explicit PageBattery(QWidget *parent = nullptr);
    ~PageBattery();
    enum
    {
        BAT_Volt,
        BAT_ChargerCurrent,
        BAT_DisChargeCurrent,
        BAT_SOC,
        BAT_BoxTemp,
        BAT_UnconNum,
        BAT_TempFaultNum,
        BAT_hydrogen,
        BAT_Cnt,
    };
    void setBatStat(int item , int index , float stat);
private:
    Ui::PageBattery *ui;
    QList<QList <QLabel *>> m_lBatStatList;
    QList<QWidget *> m_lDisplayWidgets;
    QStringList m_lBatStatNameList;
    QList<uint8_t> m_lBatStatCntOfOneCar;
private:
    void InitBatStatLabels();
    void setDefaultBrkStat();
    void SetPosition(QWidget* w, int car, uint8_t row, uint8_t col, uint8_t total, bool xReverse=false);
private:
    uint m_nStatLabelWidth_Car;
    uint m_nStatLabelHeight;
    uint m_nStatLabelStartY;
    uint m_nStatLabelSpaceX;
    uint m_nStatLabelSpaceY;
};

#endif // PAGEBATTERY_H
